Group 26 - Assignment 5

Carl Felix Freiesleben - s203521
Emilie Munk - s203538
Josefine Løken - s183784
Judith Tierno Martí - s222869
Sahand Yazdani - s203538

Intro

This is the introduction. All code is loaded here and saved as rhc_aug so this is the data name we will use for all data. Right now we have not included aug data, so we need to do that and then update other chucks that rn use rhc_clean. note to self: Eval parameter is whether to evaluate/run your chunk of code Echo parameter is whether to print the code

Materials and Methods

Materials and Methods (exploratory dataviz)

Table 1

rhc_clean |> mutate(sex = factor(sex),
                    swang1 = factor(swang1),
                    death = factor(x = death, levels = c(0,1), c("Alive","Dead"))) |> 
  table1(x = formula(~ sex + age + race + swang1 | death),
         data = _)
Alive
(N=2013)
Dead
(N=3722)
Overall
(N=5735)
sex
Female 919 (45.7%) 1624 (43.6%) 2543 (44.3%)
Male 1094 (54.3%) 2098 (56.4%) 3192 (55.7%)
age
Mean (SD) 56.5 (17.4) 64.0 (15.7) 61.4 (16.7)
Median [Min, Max] 58.0 [18.0, 102] 66.0 [18.0, 101] 64.0 [18.0, 102]
race
black 332 (16.5%) 588 (15.8%) 920 (16.0%)
other 127 (6.3%) 228 (6.1%) 355 (6.2%)
white 1554 (77.2%) 2906 (78.1%) 4460 (77.8%)
swang1
No RHC 1315 (65.3%) 2236 (60.1%) 3551 (61.9%)
RHC 698 (34.7%) 1486 (39.9%) 2184 (38.1%)

Plots

Plots

PCA

Modelling

Discussion

Conclusion